/*****************************************************************************/
/* File: Utils.h                                                          */
/* Author: rszulgo                                                           */
/*                                                                           */
/* Description:																 */
/*	Class of utils.															 */
/*****************************************************************************/
#pragma once

#include <windows.h>
#include "math.h"
#include <stdio.h>
#include <string>
#include <vector>
#include <gl\gl.h>
#include <gl\glu.h>

struct float3
{
public:
	union
	{
		struct{
			float x, y, z;
		};
		float pos[3];
	};
	float3() {};
	float3(float fX, float fY, float fZ) 
		: x(fX), y(fY), z(fZ)
	{
	}

	float3 operator * (float fX)
	{
		float3 f3R;
		f3R.x = x*fX;
		f3R.y = y*fX;
		f3R.z = z*fX;
		return f3R;
	}

	float3 operator + (float3 f3X)
	{
		float3 f3R;
		f3R.x = x*f3X.x;
		f3R.y = y*f3X.y;
		f3R.z = z*f3X.z;
		return f3R;
	}


};

class CUtils
{
public:
	CUtils(void);
	~CUtils(void);

	static void Vec3Norm(double fVec[3]);
	static void Vec3Mult(double fVec3[3], double fA);
	static double Vec3DotProduct(double fVec3A[3], double fVec3B[3]); 
	static void Vec3Add(double fVec3A[3], double fVec3B[3]); 
	static GLuint LoadRAW(char* szFileName, int iWidth, int iHeight);	//returns texture ID
	static std::vector<std::string> GetTokens(std::string sParam);		// get tokens of menu item string {keyName, keyValue)
	static std::string AsciiToKeyName(int iChar);
	static int StringToKeyValue(std::string sString);
};
